﻿using System;

namespace 第九题
{
    interface A
    {
        double area();
    }
    interface B
    {
        abstract void setColor(String c);
    }
    interface C : A, B
    {
        void volume();
    }
    class Cylinder : C
    {
        public double radius;
        public double height;
        public string color;

        public Cylinder(double radius, double height)
        {
            this.radius = radius;
            this.height = height;

        }


        public virtual double area()
        {
            return 3.14 * radius * radius;
        }
        public virtual void volume()
        {
            Console.WriteLine("体积：" + area() * height);
        }
        public virtual void setColor(String c)
        {
            color = c;
            Console.WriteLine("颜色：" + c);
        }

    }
    internal class Program
    {
        static void Main(string[] args)
        {
            Cylinder c = new Cylinder(3, 5);


            c.setColor("red");

            c.volume();

        }
    }
}
